package com.codexsoft.test;

import com.codexsoft.test.entities.User;
import org.apache.wicket.extensions.wizard.WizardStep;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.PropertyModel;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 24.08.11
 * Time: 17:05
 * To change this template use File | Settings | File Templates.
 */
public class RegPanel3 extends WizardStep {
    User user;

    public RegPanel3() {
        super("Register new user: 3-d step", "Just 2 last questions for editing");
        Form form = new Form("regform");
        user = new User();
        TextField email = new TextField("email", new PropertyModel(user, "email"));
        TextField information = new TextField("information", new PropertyModel(user, "additionalInformation"));
        form.add(email);
        form.add(information);
        add(form);
    }

    @Override
    public void applyState() {
        RegistrationWizard.getUser().setEmail(user.getEmail());
        RegistrationWizard.getUser().setAdditionalInformation(user.getAdditionalInformation());
    }
}
